﻿$(function () {
    $('#btnSearch').click(function () {
        search();
    });

    $('#btnSearch').click();
});

//加载列表
function initTable(queryData, pageNumber) {
    $("#maingrid").ligerGrid({
        height: '100%',
        url: '/NursingForm/InfantBaby/Search?ram=' + Math.random(),
        parms: queryData,
        page: pageNumber,
        rownumbers: false,
        usePager: false,
        heightDiff: 25,
        fixedCellHeight: false,
        columns: [
        {
            display: '日期', name: 'RiQi', width: 100, render: function (row) {
                return row.RiQi.split(' ')[0];
            }
        },
        { display: '时间', name: 'ShiJian', width: 80 },
        {
            display: '一般情况', name: '',
            columns: [
                { display: '体温', name: 'YiBanQingKuangTiWen', width: 100 },
                { display: '反应', name: 'YiBanQingKuangFanYing', width: 100 },
                { display: '肤色', name: 'YiBanQingKuangFuSe', width: 100 }
            ]
        },
        {
            display: '喂养', name: '',
            columns: [
                { display: '母乳', name: 'WeiYangChunMuRu', width: 100 },
                { display: '配方奶(ml)', name: 'WeiYangPeiFangNai', width: 100 }
            ]
        },
        { display: '大便次数', name: 'DaBianCiShu', width: 80 },
        { display: '大便颜色', name: 'DaBianYanSe', width: 80 },
        { display: '小便次数', name: 'XiaoBianCiShu', width: 80 },
        {
            display: '呕吐', name: '',
            columns: [
                { display: '性质', name: 'OuTuXingZhi', width: 80 },
                { display: '量(ml)', name: 'OuTuLiang', width: 80 }
            ]
        },
        { display: '脐带', name: 'QiDai', width: 80 },
        { display: '哭声', name: 'KuSheng', width: 80 },
        { display: '婴儿情况及处理', name: 'YingErQingKuangJiChuLi', minWidth: 200 },
        { display: '护士签名', name: 'HuShiQianMing', width: 100 }
        ]
    });
    GridNoData($("#maingrid"));
}

//搜索
function search(pageNumber) {
    var queryData = {
        patientId: $("#hdnPatientId").val(),
        visitId: $("#hdnVisitId").val()
    };
    initTable(queryData, pageNumber);
}
